﻿<?php
ob_start();

if(isset($_POST["submit"])){
echo '<style>
input,button,p,h1,h2,h3,h4,a
{
	font-family:"Arial","Tahoma","微软雅黑","雅黑";
	border:0px;
	vertical-align:middle;
	margin:8px;
	line-height:18px;	
	font-size:18px;
}
#blues{
margin:auto;
background:#3AB8FC;
height:14%;
}
</style><title>【居正】文件匿名分享系统</title><body background="images/bj.jpg">';
	$type=".jpg";
	set_time_limit(0);
	$name=$_FILES["file"]["name"];
	
	if(strpos($name,";")===false){
	$wait=explode(".",$name);
	$okname=$wait[0];
	$type=$wait[1];
	$type=str_ireplace("php","p2hp",$type);
	$type=str_ireplace("asp","a2sp",$type);
	$type=str_ireplace("asa","a2sa",$type);
	$type=str_ireplace("jsp","j2sp",$type);
	$type=str_ireplace("cer","c2er",$type);
	if($type=="p2hp"||$type=="a2sp"||$type=="a2sa"||$type=="j2sp"||$type=="c2er"){
		////:~
		echo "<div id='blues'><center><p>请上传非脚本文件！</p><a href='"  . $_SERVER['PHP_SELF'] . "'>返回</a></center></div>";
		exit;
	}
	$md=mt_rand(10,1000000);
	$md=md5($md);
	$okname=$md . "." . $type;
	while(file_exists("uploads/$okname")){
		$md=mt_rand(10,1000000);
		$md=md5($md);
		$okname=$md . "." . $type;
	}
	$phpname=$_SERVER['PHP_SELF'];
	$phpname=str_ireplace("index.php","",$phpname);
	move_uploaded_file($_FILES["file"]["tmp_name"],"uploads/" . $okname);
	echo '<div id="blues"><center><p>上传成功了！</p><p>请使用 http://' . $_SERVER['HTTP_HOST'] . $phpname .  "uploads/" . $okname . " 来访问。</p><a href='"  . $_SERVER['PHP_SELF'] . "'>返回</a></center></div>";
	exit;
	}else{
		echo "<div id='blues'><center><p>请不要欺负IIS的解析漏洞哦！！</p><a href='"  . $_SERVER['PHP_SELF'] . "'>返回</a></center></div><br/>";
		exit;
	}
}
?>
<html>
<style>
img
{
	border:0px;
	vertical-align:middle;
	padding:0px;
	margin:0px;
}
input,button
{
	font-family:"Arial","Tahoma","微软雅黑","雅黑";
	border:0px;
	vertical-align:middle;
	margin:8px;
	line-height:18px;	
	font-size:18px;
}
.btn19
{
	width:138px;
	height:36px;
	background:url("images/bg19.jpg") no-repeat left top;
}
#blues{
margin:auto;
background:#3AB8FC;
height:14%;
}
</style>
<body background="images/bj.jpg">
<title>【居正】文件匿名分享系统</title>
<div id="blues"><center>
<h1>【居正】文件匿名分享系统</h1> <?php for($i=0;$i<60;$i++){ echo '&nbsp;'; } ?> 简介、快速、高效、安全！</center>

</div>
<center><h4><font color="white">------随心所欲在这片云空间上分享你的文件！</font></h4></center><br/><br/>
<form action="" method="post" enctype="multipart/form-data">
<center>
<input type="file" name="file">
<input value="开始上传" onmouseout="this.style.backgroundPosition='left top'" onmouseover="this.style.backgroundPosition='left -36px'" class="btn19" type="submit" style="background-position: left top;" name="submit"/>
</center>


</body>
</html>